// let age = prompt("请输入出生的年份：")
// var now = new Date();
// alert(now.getFullYear() - age )

// let year = prompt("输入年份：")
// if ( year % 4 === 0 && year%100 !== 0 || year % 400 === 0  ) {
//     alert("这是闰年")
// }else {
//     alert("这不是闰年")
// }


// let num = prompt("输入一个数字")
// num = num >= 10 ? num:  ('0'+num);
// console.log(typeof num , num)

// switch (num){
//     case 1:
//         break;
//     case 2:
//         break;
//     default :
//         break ;
// }

let str =''
for (let i = 1; i <= 5; i++) {
    for (let j = i; j <= 5; j++) {
        str = str + "*";
    }
   str += '\n'
}
console.log(str)

let sc =''
for (let i = 1; i <= 9; i++) {
    for (let j = i; j <= 9; j++) {
        str = str + i + "*" + j + " = " + i*j;
    }
    str += '\n'
}
console.log(str)


let array = new Array(1,2,3);
let a = array.length
let sum = 0
for (let i = 0; i < a; i++) {
    sum += array[i]

}
console.log(sum)

let arrays = ['hello', 'world', '!']

console.log(arrays.toString())
console.log(arrays.join("--"))

let nums = [1,2,232,53,2,12123,23,13,324]
for (let i = 0; i < nums.length; i++) {
    for (let j = i; j < nums.length; j++) {
        if(nums[i] > nums[j]){
            let a = nums[i]
            nums[i] = nums[j]
            nums[j] = a
        }
    }
}
console.log(nums)
let dat = "ok"

console.log("ok" === dat)



